import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import eslintPlugin from 'vite-plugin-eslint'
import ElementPlus from 'unplugin-element-plus/vite'

export default defineConfig({
	plugins: [
		vue(),
		eslintPlugin({
			include: ['**/*.ts', '*.ts', '**/*.vue', '*.vue']
		}),
		ElementPlus()
	],
	server: {
		port: 8866,
		host: true,
		proxy: {
			'^/api': {
				// target: 'https://localhost:8010',
				target: 'https://cms.coderwyf.com',
				changeOrigin: true,
				rewrite: (path) => path.replace(/^\/api/, '')
			}
		}
	},
	resolve: {
		alias: {
			'@': '/src'
		}
	}
})
